package cn.edu.scau.cmi.xuandingcong.composite.consistent;

import java.util.List;
import java.util.Set;



public class Team extends Component{

	String name;

	@Override
	public Component addChild(Component child) {
		childrens.add(child);
		return this;
	}

	@Override
	public Component deleteChild(Component child) {
		childrens.remove(child);
		return this;
	}

	@Override
	public List<Component> getChild() {
		return childrens;
	}


	@Override
	public void print(int i) {
		for(int j=0;j<i;j++) {
			System.out.print("--");
		}
		System.out.println(this.name);
		for(Component component:childrens) {
			component.print(i+1);
		}
	}
	
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getSize() {
		return childrens.size();
	}
	
	public Team() {}

	public Team(String name) {
		this.name = name;
	}

}